const app = getApp()
var t = getApp(), a = t.requirejs("core"), e = t.requirejs("wxParse/wxParse"), i = t.requirejs("biz/diypage"), s = t.requirejs("biz/diyform"), n = t.requirejs("biz/goodspicker"), o = (t.requirejs("foxui"), 
t.requirejs("jquery"));
Component({
  properties: {
    openid:{
      type:String,
      value:'',
    }
  },
  data: {
  },
  attached(){
    this.getData()
  },
  methods: {
   getData(){
      let that=this;
      a.post("sns/user/get_userinfo", {
        id:that.data.openid,
      }, function(res) {
        that.setData({
          boardcount:res.boardcount,
          boards:res.boards,
          followcount:res.followcount,
          level:res.level,
          member:res.member,
          postcount:res.postcount,
          posts:res.posts,
        })
        // t.setData({
        //   info:res.category
        // })
      });
   },
   articlelist(){
    wx.navigateTo({
      url: '/pages/community/article/articleList/index?openid='+this.data.openid,
    })
   },
   goboards(e){
     wx.navigateTo({
       url: '/pages/community/essence/index?bid='+e.currentTarget.dataset.bid,
     })
   },
   goArticle(e){
    wx.navigateTo({
      url: '/pages/community/article/index?id='+e.currentTarget.dataset.id,
    })
   },
   onshow(){
      this.getData()
   }
  }
  
})